<template>
   <div>
    <h1 v-on:click='makeMoney'>好好学习，努力挣钱！</h1>
    <h2 @click='makeCatalog'>天天向上，拼命加班</h2>
   </div>
</template>
<script>
export default {
    name:'MakeMoney',
    data:function(){
      return {money:0}
    },
    methods:{
      makeMoney:function(){
            console.log(this.money)
             this.money++
      },
      //客户端缓存有哪些？浏览器 cookie 4kb，sessionstorage，localstorage
      makeCatalog:function(){
           let obj=[];
           for(let i=0;i<2000;i++){
                  let ob={};
                  ob.name='目录'+i;
                  ob.id=i
                  obj.push(ob)
           }
           //sessionStorage 浏览器关闭就没了
           sessionStorage.setItem('catalog',JSON.stringify(obj))

      }
      

    }
}
</script>
<style scoped>
  h1{color:rgb(4, 46, 46);}
</style>